package com.java.comprehensive.design.building_modelling.factory_pattern.coffee.fac;

class CoffeeStore {
    private CoffeeFactory coffeeFactory;

    public void setCoffeeFactory(CoffeeFactory coffeeFactory) {
        this.coffeeFactory = coffeeFactory;
    }

    public Coffee orderCoffee() {
        Coffee coffee = coffeeFactory.createCoffee();
        addCoffeeAttr(coffee);
        return coffee;
    }

    private void addCoffeeAttr(Coffee coffee) {
        coffee.addSugar();
        coffee.addMilk();
    }


}
